﻿using System;
using System.Reflection;

namespace Ue.CQRS.Events
{
    public class DomainEventBuilder : IEventBuilder
    {
        public IEvent Build(EventAttribute eventAttribute, dynamic sender, dynamic eventArgs)
        {
            return this.Build(eventAttribute.Name, eventAttribute.Level, eventArgs);
        }

        private DomainEvent<T> Build<T>(string name, int level, T eventArgs)
        {
            return new DomainEvent<T>(name, level, eventArgs);
        }
    }
}
